<template>
   <el-table size="small" ref="table_s_exp_2" :height="activeHeight1" style="width: 100%"
                                    :header-cell-style="{
                                        background: '#fafbfc',
                                        color: '#333333',
                                    }" :data="nozzlesData" :row-class-name="tableRowClassName">
                                    <el-table-column label="序号" type="index" />
                                    <el-table-column show-overflow-tooltip prop="nozzle_name" label="管口名称"
                                        align="center" />
                                    <el-table-column show-overflow-tooltip label="管口尺寸"
                                        prop="nozzle_npd"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="法兰磅级"
                                        prop="nozzle_rating"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="法兰标准"
                                        prop="nozzle_standard"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="密封面形式"
                                        prop="nozzle_preparation"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="开孔位置"
                                        prop="nozzle_location"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="参数A"
                                        prop="parameter_6"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="参数B"
                                        prop="parameter_7"></el-table-column>

                                    <el-table-column show-overflow-tooltip label="参数C"
                                        prop="parameter_8"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="参数D"
                                        prop="parameter_9"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="参数E"
                                        prop="parameter_10"></el-table-column>
                                    <el-table-column show-overflow-tooltip label="参数F"
                                        prop="parameter_11"></el-table-column>
                                    <el-table-column width="120" label="操作">
                                        <template #default="scope">
                                            <el-tooltip effect="dark" content="编辑" placement="top">
                                                <el-button @click="editRownozzles(scope.$index, scope.row)" size="small"
                                                    type="primary" :icon="Edit" circle>
                                                </el-button>
                                            </el-tooltip>

                                            <el-tooltip effect="dark" content="复制" placement="top" :open-delay="800">
                                                <el-button @click="copyRownozzles(scope.row, nozzlesData)" size="small"
                                                    type="info" :icon="DocumentCopy" circle />
                                            </el-tooltip>

                                            <el-popconfirm placement="left"
                                                @confirm="deleteRowNozzle(scope.$index, nozzlesData)" title="确定要删除?">
                                                <template #reference>
                                                    <el-button size="small" type="danger" :icon="Delete" circle />
                                                </template>
                                            </el-popconfirm>

                                            <!-- <span style="color: #1890ff; margin: 1em;font-size:12px;cursor: pointer;" size="small" @click="handleEdit(scope.$index, scope.row)">编辑</span>
                   <el-popconfirm title="确定要删除了?" @confirm="confirmEvent(scope.$index, scope.row)">
                     <template #reference>
                       <span style="color: #189eff;;font-size:12px;cursor: pointer;">删除</span>
                     </template>
                   </el-popconfirm> -->
                                        </template>
                                    </el-table-column>
                                </el-table>
</template>

<script setup>
    import { ref, reactive, onMounted, watch, nextTick } from "vue";
    import {
        Download,
        Upload,
        Calendar,
        Check,
        Delete,
        Edit,
        Message,
        Search,
        Star,
        DocumentCopy,
        Top,
        Bottom,
        Guide,
        Coordinate,
    } from "@element-plus/icons-vue";

    let props = defineProps(['activeHeight1','nozzlesData','tableRowClassName']);
 let emit = defineEmits(['editRownozzles','copyRownozzles','deleteRowNozzle'])
  let activeHeight1 = ref(0)
  let nozzlesData = ref([])
  let tableRowClassName =ref('')
  watch(props,()=>{
    activeHeight1.value = props.activeHeight1
    nozzlesData.value = props.nozzlesData
    tableRowClassName.value = props.tableRowClassName
},{deep:true})


let editRownozzles = (index, row) => {
    emit('editRownozzles',index, row)
}

let copyRownozzles = (row,data) => {
    emit('copyRownozzles',row,data)
}




let deleteRowNozzle = (index, data) => {
    emit('deleteRowNozzle',index, data)
}


</script>

<style></style>